/**
	License:		Artistic license 2.0 (see license.txt, also available online at http://www.perlfoundation.org/artistic_license_2_0)
	Authors:		OrbitalLab (http://www.orbitallab.ru/moonglide/), 2007-2009

	File:			EngSprite.d
	Description:	sprite base class
	Date:			16.11.2007 by Digited
*/
module moonglide.core.engobjects.EngSprite;

import
	moonglide.core.engobjects.EngObject,
	moonglide.resources.resobjects.hilevel.ResMaterial;

//=============================================================
/// CEngSprite - basic renderable sprite class
//=============================================================
class CEngSprite : public CEngObject
{
	public:
		CResMaterial mat;
		Vector3f            coord2d;


		this( char[] idname = "EngSprite")
		{
			super( idname );
			mat = CResMaterial( _id ~ "_mat" );

            floats["alphadelta"]    = 0.01f;
            floats["rotSpeed"]      = 0.5f;
			bools["ScreenAligned"]	= true;
			bools["ZVisiTest"]	    = true;
			bools["rot"]	        = true;

			with( mat )
			{
				bools["Blend"]		= true;
				bools["Lighting"]	= false;
				bools["DepthTest"]	= false;

                ints["DepthMask"]	= 0;

				sourceBlendFactor	= EMatBlendSFactor.src_alpha;
				destBlendFactor		= EMatBlendDFactor.one;
			}

			size = Vector3f( 1.f, 1.f, 1.f );

		}


		~this()
		{
			debug debugLog.trace( "sprite destroy begin: " ~ _id );

			mat.release;
		}
}
